#include<iostream>
#include<vector>
#include<string>

using namespace std;

class Solution {
public:
    void rotate(vector<int>& nums, int k) {
        
       int length = nums.size();
       k = k % length;
       if (k == 0) return;
       vector<int> temp(length);
       for (size_t i =0;i < length; i++) {
            temp[(i+k)%length] = nums[i];
       }
       nums.assign(temp.begin(), temp.end());

    }

};